﻿using GdNet.Core.Domain;
using GdNet.Core.Domain.Metadata;
using GdNet.Integrations.NHibernate.Assistants;
using NHibernate.Mapping.ByCode.Conformist;

namespace GdNet.Integrations.NHibernate.Mapping
{
    public abstract class AbstractJoinedSubclassMapping<TObject, TId> : JoinedSubclassMapping<TObject>
        where TObject : AbstractEntity<TId>
    {
        protected AbstractJoinedSubclassMapping()
        {
            base.DynamicUpdate(true);
            base.DynamicInsert(true);

            base.Table(MappingAssistant.GetTableStrongName(typeof(TObject)));
            base.Key(km => km.Column(EntityMeta.Id));
        }
    }
}
